# $Id$
# Maintainer: Maxime Gauduin <alucryd at gmail dot com>

pkgname=noise-player
pkgver=0.4.0.3
pkgrel=1
pkgdesc='The Pantheon Music Player'
arch=('i686' 'loong64' 'x86_64')
url='https://launchpad.net/noise'
license=('GPL3')
groups=('pantheon')
depends=('cairo' 'gdk-pixbuf2' 'glib2' 'glibc' 'gst-plugins-base-libs'
         'gstreamer' 'gtk3' 'json-glib' 'libaccounts-glib' 'libgda' 'libgee'
         'libgpod' 'libgsignon-glib' 'libpeas' 'libsoup' 'pango' 'taglib'
         'zeitgeist'
         'libgranite.so')
makedepends=('cmake' 'gobject-introspection' 'intltool' 'vala')
optdepends=('gst-plugins-base: "Base" plugin libraries'
            'gst-plugins-good: "Good" plugin libraries'
            'gst-plugins-bad: "Bad" plugin libraries'
            'gst-plugins-ugly: "Ugly" plugin libraries')
replaces=('noise')
source=("https://launchpad.net/noise/0.4.x/${pkgver}/+download/noise-${pkgver}.tar.xz"
        'mesa-demos-conflict.patch'
        'noise-install-dirs.patch')
sha256sums=('9eb0aa8370d60e8cba289bce2b4df7c9c8a52fecfce637260c05f20d2efec27c'
            '9135fe677b0d61778a624ba211b545eb861468b500cfd161469aa28139ab1296'
            'd0ebc710a742d942e04a8df61d91dd75ae4b2aeafe7fece08f1fbc90c507f1df')

prepare() {
  cd noise-${pkgver}

  patch -Np1 -i ../mesa-demos-conflict.patch
  patch -Np1 -i ../noise-install-dirs.patch

  if [[ -d build ]]; then
    rm -rf build
  fi
  mkdir build

}

build() {
  cd noise-${pkgver}/build

  cmake .. \
    -DCMAKE_BUILD_TYPE='Release' \
    -DCMAKE_INSTALL_PREFIX='/usr' \
    -DCMAKE_INSTALL_LIBDIR='/usr/lib' \
    -DGSETTINGS_COMPILE='FALSE'
  make -j1
}

package() {
  cd noise-${pkgver}/build

  make DESTDIR="${pkgdir}" install
}

# vim: ts=2 sw=2 et:
